from . import index_blu
from info import redis_store


# 2.使用蓝图对象注册路由
@index_blu.route('/', methods=['GET', 'POST'])
def index():
    # 测试redis数据库
    # redis_store.set('name', 'itheima')
    # 测试session有没有被添加到数据库
    # session['name'] = 'itcast'

    # 演示日志输出
    # import logging
    # logging.fatal('This is a fatal.log')
    # logging.error('This is a error.log')
    # logging.warning('This is a warning.log')
    # logging.info('This is a info.log')
    # logging.debug('This is a debug.log')

    # 演示flask项目自带输出日志的方法
    # current_app.logger.fatal('This is a fatal.log')
    # current_app.logger.error('This is a error.log')
    # current_app.logger.warning('This is a warning.log')
    # current_app.logger.info('This is a info.log')
    # current_app.logger.debug('This is a debug.log')
    redis_store.set('age', 18)
    return 'index'
